<{include file='customer/head.html'}>
<body>
	<div class="akrPop">
		<form id="sub_form">
			<ul class="ulForm">
				<li>
					<label class="form-label">登录名称：</label>
					<div class="form-input">
						<input type="text" class="inputText" name="name" value="">
					</div>
				</li>
				<li>
					<label class="form-label">显示名称：</label>
					<div class="form-input">
						<input type="text" class="inputText" name="displayname" value="">
					</div>
				</li>
				<li>
					<label class="form-label">手机号码：</label>
					<div class="form-input">
						<input type="text" class="inputText" name="mobile" value="">
					</div>
				</li>
				<li>
					<label class="form-label">密码：</label>
					<div class="form-input">
						<input type="password" class="inputText" name="pwd" value="">
					</div>
				</li>
				<li>
					<label class="form-label">确认密码：</label>
					<div class="form-input">
						<input type="password" class="inputText" name="pwdok" value="">
					</div>
				</li>
				<li>
					<label class="form-label">上传头像：</label>
					<div class="form-input">
						<div class="dib hcinits_uploads_file_imgshow" style="display: none;">
			                <img class="hcinits_uploads_file_face_images uploadImg" src="" />
			            </div>
						<div class="akrfile">选择图片
				            <input type="hidden" class="hcinits_uploads_file_face_name" name="face" value="">
							<div class="hcinits_uploads_file" id="uploadone"></div>
						</div>
					</div>
				</li>
				<li>
					<label class="form-label">是否超级管理员：</label>
					<div class="form-input">
						<dl class="label_beauty">
							<dd>
								<input type="radio" name="isitadministrator" value="1" id="isitadministrator_1">
								<label for="isitadministrator_1">是</label>
							</dd>
							<dd>
								<input type="radio" name="isitadministrator" checked value="0" id="isitadministrator_0">
								<label for="isitadministrator_0">否</label>
							</dd>
						</dl>
					</div>
				</li>
				<li>
					<label class="form-label">职位：</label>
					<div class="form-input">
						<dl class="label_beauty">
							<dd>
								<input type="radio" name="type" checked value="0" id="job_0">
								<label for="job_0">研发</label>
							</dd>
							<dd>
								<input type="radio" name="type" value="1" id="job_1">
								<label for="job_1">销售</label>
							</dd>
							<dd>
								<input type="radio" name="type" value="2" id="job_2">
								<label for="job_2">技术</label>
							</dd>
						</dl>
					</div>
				</li>
				<li>
					<label class="form-label">性别：</label>
					<div class="form-input">
						<dl class="label_beauty">
							<dd>
								<input type="radio" name="sex" checked value="男" id="sex_male">
								<label for="sex_male">男</label>
							</dd>
								<input type="radio" name="sex" value="女" id="sex_female">
								<label for="sex_female">女</label>
							</dd>
						</dl>
					</div>
				</li>
				<li>
					<label class="form-label">状态：</label>
					<div class="form-input">
						<dl class="label_beauty">
							<dd>
								<input type="radio" name="status" value="0" id="status_0">
								<label for="status_0">未启用</label>
							</dd>
							<dd>
								<input type="radio" name="status" checked value="1" id="status_1">
								<label for="status_1">正常</label>
							</dd>
							<dd>
								<input type="radio" name="status" value="2" id="status_2">
								<label for="status_2">停用</label>
							</dd>
						</dl>
					</div>
				</li>
				<li>
					<label class="form-label">权限：</label>
					<div class="form-input">
						<dl class="label_beauty">
							<dd>
								<input type="checkbox" name="powerlist[]" value="1" id="powerlist_1" />
								<label for="powerlist_1">创建</label>
							</dd>
							<dd>
								<input type="checkbox" name="powerlist[]" value="2" id="powerlist_2" />
								<label for="powerlist_2">项目经理审核</label>
							</dd>
							<dd>
								<input type="checkbox" name="powerlist[]" value="4" id="powerlist_4" />
								<label for="powerlist_4">总经理审核</label>
							</dd>
							<dd>
								<input type="checkbox" name="powerlist[]" value="8" id="powerlist_8" />
								<label for="powerlist_8">研发</label>
							</dd>
							<dd>
								<input type="checkbox" name="powerlist[]" value="16" id="powerlist_16" />
								<label for="powerlist_16">完成</label>
							</dd>
						</dl>
					</div>
				</li>
				<li>
					<label class="form-label"></label>
					<div class="form-input">
						<input type="button" class="sub_form_botton akrBtn akrBtn-md blue" value="提交">
					</div>
				</li>
			</ul>
		</form>
	</div>
	<script type="text/javascript"> 
		//上传单张图片
		function uploadimgone(){
			var postdata={savePath:'attachment'};
			var uploadid='uploadone';
			var formAction='/Ups/imageone';
			_hcinits.init(['_upload_min','_layer_admin_min'],function(){
				_layer_admin=_hcinits._layer_admin;
				_uploadfile=_hcinits._uploadfile;
				_uploadfile.initdiv({'upId':uploadid,'formAction':formAction},postdata,function(returnback){
					data=returnback[0];
	            	data=JSON.parse(data);
	            	console.log(data);
	            	if(data.status){
	            		_layer_admin.successMsg(data.message,function(){
	            			$('.hcinits_uploads_file_imgshow').show();
	            			$('.hcinits_uploads_file_face_name').val(data.img);
	            			$('.hcinits_uploads_file_face_images').attr('src',data.imgshow);
	            		});
	            	}else{
	            		_layer_admin.errorMsg(data.message);
	            	}
				});
			})
		}
		uploadimgone();
		//上传结束
		$(function(){
			//添加提交
			var addstatus=true;
			$('.sub_form_botton').click(function(){
				_hcinits.init(['_ajaxs_min','_layer_admin_min'],function(){
					_ajaxs=_hcinits._ajaxs;
					_layer_admin=_hcinits._layer_admin;
					 postdata=_ajaxs.from('#sub_form');
					 if(addstatus===true){
						addstatus=false;
						_ajaxs.post('/User/userAdd',postdata,function(data){
							addstatus=true;
							if(data.status){
								_layer_admin.successMsg(data.message,3)
							}else{
								_layer_admin.errorMsg(data.message);
							}
						})
					 }
				})
			})
		})
	</script>
</body>
</html>